#include #include #include using namespace std; //a string length is the number of chars in the string before the /0 int stringLength( const char s[] ) { int length = 0; while(s[length] != '\0') { length++; } return length; } void getSecretLine( char s[], int maxLength ) { int length = 0; do { s[length] = getch(); if(s[length] == ' ') { cout << ' '; } else if(s[length] != '\r') { cout << "*"; } length++; } while(s[length-1] != '\r' && length < maxLength); s[length-1] = '\0'; } void copyString(char destination[], const char source[]) { int i = -1; do { i++; destination[i] = source[i]; } while(source[i] != '\0'); } void main() { char s[100]; char s2[10]; //cin.getline(s,100); //bob getSecretLine(s, 100); cout << stringLength(s) << endl; cout << strlen(s) << endl; //s2 = s; //copyString(s2, s); strcpy(s2,s); //strcpy_s(s2,10,s); //start here tomorrow cout << s << endl; cout << s2 << endl; }